﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CharacterPattern : MonoBehaviour
{

    public bool darkPattern;
    public bool lightPattern;
    public bool elementPattern;
    public bool truthPattern;
    public bool timePattern;

    public bool canChangePattern;
    private int currentPattern;

    private void Awake()
    {
        canChangePattern = true;
        darkPattern = true;
        lightPattern = true;
        elementPattern = true;
        truthPattern = true;
        timePattern = true;
        currentPattern = 0;
    }

    private void Update()
    {
        if(Input.GetButtonDown("ChangePattern"))
        {
            if(currentPattern == 4)
            {
                currentPattern = -1;
            }
            currentPattern++;
            ChangePattern(currentPattern);
        }
    }


    void ChangePattern(int patternNum)
    {
        if(!canChangePattern)
        {
            return;
        }

        switch(patternNum)
        {
            case 0:
                changeDarkPattern();
                break;
            case 1:
                changeLightPattern();
                break;
            case 2:
                changeElementPattern();
                break;
            case 3:
                changeTruthPattern();
                break;
            case 4:
                changeTimePattern();
                break;
        }

        //发送切换形态指令,更新attackControl中的数据
    }

    private void changeDarkPattern()
    {
        if(darkPattern)
        {
            print("切换到暗影形态");
        }
    }

    private void changeLightPattern()
    {
        if (lightPattern)
        {
            print("切换到光明形态");
        }
    }

    private void changeElementPattern()
    {
        if (elementPattern)
        {
            print("切换到元素形态");
        }
    }

    private void changeTruthPattern()
    {
        if (truthPattern)
        {
            print("切换到真理形态");
        }
    }

    private void changeTimePattern()
    {
        if (timePattern)
        {
            print("切换到时间形态");
        }
    }
}
